package com.yaofeng.mybatis.util;

import org.apache.shiro.crypto.hash.Sha256Hash;

/**
 * share256hash  加密不可逆
 * Created by yaofeng on 2019/8/30.
 */
public class Sha256Util {


    /**
     * sha256hash 加密
     *
     * @param source 数据源
     * @param salt   盐值
     * @return
     */
    public static String encoder(String source, String salt) {
        return new Sha256Hash(source, salt).toHex();
    }


    public static void main(String[] args) {
        System.out.println(encoder("admin","bE5sb5f5tI89f5CLaQtf"));
    }
}
